package cn.tedu.fresheveryday.controller;

import cn.tedu.fresheveryday.pojo.vo.OrderStatusHistoryVO;
import cn.tedu.fresheveryday.service.IOderStatusHistoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "订单状态历史模块")
@RequestMapping(path = "/order_status_history", produces = "application/json;charset=utf-8")
public class OrderStatusHistoryController {
    @Autowired
    private IOderStatusHistoryService service;

    /**
     * 通过订单号查询订单的状态历史
     * @param orderId 订单号
     * @return
     */
    @GetMapping("/selectByOrderId")
    @ApiOperation("通过订单号查询订单的状态历史")
    @ApiImplicitParam(value = "orderId", name = "orderId", required = true)
    public List<OrderStatusHistoryVO> selectByOrderId(String orderId) {
        return service.selectByOrderId(orderId);
    }

}